#include <stdio.h>
#include <stdlib.h>

// sum_of_factors 函数已实现，只需完成main函数即可
unsigned sum_of_factors(unsigned n); //请不要删除，否则编译不通过

int main(){
int i,j,n;
scanf("%d",&n);
for(i=1;i<=n;i++){
    j= sum_of_factors(i);
    if(i==sum_of_factors(j)&&i!=j&&i<j)
    {printf("(%d,%d)",i,j);}
}
return 0;
    
}
